home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / Fight / armadilloknight.swf / scripts / DefineSprite_298 / frame_1 / PlaceObject2_148_362 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Text File  |  2006-05-08  |  1KB  |  65 lines

  1. onClipEvent(load){
  2.    function vReset()
  3.    {
  4.       prevPose = "";
  5.       pose = "jump";
  6.       attackPwr = 20;
  7.       touchAttack = 8;
  8.       hp = 60;
  9.       vVelocity = 0;
  10.       gravity = 4;
  11.       tVelocity = 30;
  12.       grounded = false;
  13.       hVelocity = 0;
  14.       maxSpeed = 6;
  15.       speed = 6;
  16.       this._x = startX;
  17.       this._y = starty;
  18.       stunned = false;
  19.       attacking = false;
  20.       waitTimer = 58;
  21.       waitDelay = 60;
  22.       goFight = false;
  23.       dead = false;
  24.    }
  25.    function die()
  26.    {
  27.       _parent.deathEffect._x = this._x;
  28.       _parent.deathEffect._y = this._y;
  29.       _parent.deathEffect.gotoAndPlay(2);
  30.       _parent.deathEffect.s.start();
  31.       this._y = _root.world.safeY;
  32.       _parent.spang._y = _root.world.safeY;
  33.       _parent.player.score += 600;
  34.       dead = true;
  35.    }
  36.    function getHit(damage, xoff)
  37.    {
  38.       hp -= damage;
  39.       stunned = true;
  40.       if(0 >= hp)
  41.       {
  42.          hp = 0;
  43.          die();
  44.       }
  45.       if(xoff < this._x)
  46.       {
  47.          this.vVelocity = -10;
  48.          this.hVelocity = 10;
  49.          grounded = false;
  50.       }
  51.       else
  52.       {
  53.          this.vVelocity = -10;
  54.          this.hVelocity = -10;
  55.          grounded = false;
  56.       }
  57.    }
  58.    slash = new Sound(this);
  59.    slash.attachSound("slash2");
  60.    startX = this._x;
  61.    startY = this._y;
  62.    attackTarget = _parent.player._x;
  63.    vReset();
  64. }
  65.